package internal

import (
	"roll/internal/server/pkg/module"

	"go.uber.org/fx"
	"go.uber.org/zap"
)

type launchParams struct {
	fx.In
	ServiceBinder *module.ServiceBinder
	Lifecycle     fx.Lifecycle
	Logger        *zap.Logger
}

func Launch(in launchParams) (err error) {
	in.Logger.Info("launching...")
	if err = in.ServiceBinder.Bind(in.Logger, in.Lifecycle); err != nil {
		return err
	}
	return err
}
